package org.jeecg.enums.meter;

public enum MeterBeginStatusEnum {
    METER_DEDUCT_BEGIN_NOT(0, "正常状态"),
    METER_DEDUCT_BEGIN_YES(1, "初始值");

    private Integer code;
    private String desc;

    MeterBeginStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }


    public static String getDesc(Integer value) {
        MeterBeginStatusEnum[] enums = values();
        for (MeterBeginStatusEnum typeEnum : enums) {
            if (value.intValue() == typeEnum.getCode().intValue()) {
                return typeEnum.desc;
            }
        }
        return "";
    }

    public static Integer getValue(String desc) {
        MeterBeginStatusEnum[] enums = values();
        for (MeterBeginStatusEnum typeEnum : enums) {
            if (typeEnum.getDesc().equals(desc)) {
                return typeEnum.code;
            }
        }
        return null;
    }
}
